Repository navigation
Release through a stage-only trusted publisher, with a checklist - #4
Merged
Merged
Conversation
Replaces the Publish workflow, which needed a stored NPM_TOKEN. npm is restricting tokens that bypass 2FA, and a token that can publish is the thing worth stealing. release.yml stages any version npm does not have, through npm's trusted publisher for this repository. A staged package is not public until a maintainer approves it with 2FA. RELEASING.md is the checklist. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Deploying dor-tools with
|
| Latest commit: |
4a5f469
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://03e810f7.dor-tools.pages.dev |
| Branch Preview URL: | https://trusted-publishing.dor-tools.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the token-based Publish workflow with the pattern
diffplug/pgstencilalready uses: the workflow can only stage a release, and a person approves it with 2FA. AddsRELEASING.md, the release checklist.Why
The Publish workflow from #1 needed a stored
NPM_TOKEN. npm is restricting tokens that bypass 2FA, and a stored token that can publish is exactly what an attacker wants. With a stage-only trusted publisher there is no token, and a stolen workflow can stage a version but cannot make it public.What changes
.github/workflows/release.yml(new), adapted from pgstencil's:main, it finds each of the three versions npm does not have. They must share one version.stagejob runs in thepublishenvironment: it installs, runspnpm test, packs each package with pnpm, and runsnpm stage publishon the archive.workspace:*dependency as the version it names.stagejob is skipped..github/workflows/publish.ymlis deleted.RELEASING.md(new): the seven-step checklist, from the version pull request through approval, the tag, the site check, and moving Dormouse's pin. It also records how publishing is locked down.One difference from pgstencil: that workflow waits for its
security-auditcheck before staging. This repository has no such check, so the stage job runs the tests itself.Setup this needs before the next release
None of it exists yet.
RELEASING.mddescribes the end state.publishon this repository, limited to themainbranch.diffplug, repositorydor-tools, workflowrelease.yml, environmentpublish, and "can also publish directly withnpm publish" left unchecked.Verified
actionlintpasses onrelease.yml.dor-tools-api-<version>.tgzand so on); seen when packing 0.1.0.RELEASING.mdfollows Dormouse's one-paragraph-per-line rule, which its lint applies to this repository through the submodule.Not verified
planjob alone.npm stage publishon an archive packed by pnpm. pgstencil stages archives its own script packs.🤖 Generated with Claude Code